package com.ziyan.error;

public class UCException extends RuntimeException {

    private UCExceptionData data;

    public UCException(ErrorCode code) {
        super(code.getMessage());
        data = new UCExceptionData(code.getCode(), code.getMessage());
    }

    public UCException(ErrorCode code, String extInfo) {
        super(code.getMessage() + extInfo);
        data = new UCExceptionData(code.getCode(), code.getMessage() + ":" + extInfo);
    }

    public UCExceptionData getData() {
        return data;
    }
}
